package com.fengxing.ams.web.facade.mouble.user;

import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.PagingAndSortingRepository;
import org.springframework.data.repository.query.Param;

public interface IResetTokenDAO extends PagingAndSortingRepository<ResetTokenVO, String>, JpaSpecificationExecutor<ResetTokenVO> {


	@Query(value = "select * from zyt_reset_token where email=:email and status=0", nativeQuery=true)
	ResetTokenVO findByEmail(@Param("email")String email);

	@Modifying
	@Query("delete from  ResetTokenVO where email=:email")
	void deleteByEmail(@Param("email")String email);

//	@Modifying
//	@Query("update UserVO set mobile =:mobile where userId = :id")
//	void updateMobile(@Param("mobile")String mobile, @Param("id")Long userId);
}
